package com.marvels.financial.loan.dao;

import com.marvels.financial.loan.dto.McfePaymentTransferDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 11271
 * @date 2024/3/13 11:52
 * @Description:
 */
public interface McfePaymentTransferDao {


    /**
     * 插入代扣申请
     * @param record
     * @return
     */
    int insertSelective(McfePaymentTransferDTO record);


    /**
     * 更新代扣申请
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(McfePaymentTransferDTO record);




    /**
     * 根据WithholdCode查询代扣流水
     * @param record
     * @return
     */
    public McfePaymentTransferDTO selectByWithholdCode(@Param("withholdCode") String withholdCode);



    /**
     * 通过还款计划插入
     * @return
     */
    public int insertWithholdByBatch(@Param("batchName") String batchName);


    /**
     * 放款后第二天开始每天进行扣款,扣款金额=((应还款本金/7)+(应还款管理费/7))*第几日-已还款本金-已还款管理费+应还违约金+应还滞纳金-已还违约金-已还滞纳金
     * @return
     */
    public int newInsertWithholdByBatch(@Param("batchName") String batchName);


    /**
     * 根据批次查询代扣流水列表
     * @param record
     * @return
     */
    public List<McfePaymentTransferDTO> selectByBatchName(@Param("batchName") String batchName);

}
